﻿using System;
using System.Collections.Generic;
using System.Text;
using OgilvyOne.DALFactory;
using System.Data;

namespace OgilvyOne.BLL
{
    public class RoleBll
    {
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        public bool Exists(string rolename,int rid)
        {
            return RoleFactory.create().Exists(rolename,rid);
        }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(OgilvyOne.Model.RoleModel model)
        {
            return RoleFactory.create().Add(model)>0;
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(OgilvyOne.Model.RoleModel model)
        {
            return RoleFactory.create().Update(model);
        }
        /// <summary>
        /// 删除一条数据
        /// </summary>
        public bool Delete(string name)
        {
            return RoleFactory.create().Delete(name);
        }
        public bool Deletelist(string rid)
        {
            return RoleFactory.create().DeleteList(rid);
        }
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public OgilvyOne.Model.RoleModel GetModel(string name)
        {
            return RoleFactory.create().GetModel(name);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return RoleFactory.create().GetList(strWhere);
        }
        /// <summary>
        /// 获得前几行数据
        /// </summary>
        public DataSet GetList(int Top, string strWhere, string filedOrder)
        {
            return RoleFactory.create().GetList(Top, strWhere, filedOrder);
        }
    }
}
